/**
 * Created by Henry on 15/6/21.
 */
Ext.define('Admin.view.main.region.Header', {
    extend: 'Ext.Toolbar',
    xtype: 'appheader',
    id: 'app-header',

    requires: [
        'Admin.view.main.region.StationSwitcher',
        'Ext.ux.Transparent'
    ],

    height: 52,
    defaultType: 'btntransparent',

    items: [{
        xtype: 'label',
        id: 'app-header-title',
        bind: {
            text: '{system.title}'
        }
    }, {
        xtype: 'label',
        id: 'app-header-version',
        bind: {
            text: '{system.version}'
        }
    }, '->', {
        text: '首页',
        handler: 'redirectToHome',
        glyph: 0xf015
    }, {
        text: '帮助',
        glyph: 0xf059
    }, {
        text: '关于',
        glyph: 0xf06a
    }, '->', '->', {
        xtype: 'stationswitcher'
    }, {
        text: '搜索',
        glyph: 0xf002
    }, {
        text: '注销',
        handler: 'doLogout',
        glyph: 0xf08b
    }, {
        glyph: 0xf102,
        handler: 'hiddenHeaderFooter',
        tooltip: '隐藏顶部和底部区域',
        disableMouseOver: true
    }],

    initComponent: function () {
        document.title = this.up('viewport').getViewModel().get('system.title');
        this.callParent();
    }
});